package com.thinkingstar.iads.common.uploadFile.vo;

import javax.servlet.http.HttpServletRequest;

import com.thinkingstar.iads.common.utils.UploadFileUtil;
import com.thinkingstar.iads.cs.sys.entity.SysDbDriver;
import com.thinkingstar.iads.cs.sys.entity.SysUser;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class UploadFileInfoVO {
	
	public String id; //主键
	public String path; //文件实际存储路径
	public String ext; //文件后缀
	public String name; //原始文件名
	
	public String token; //密钥
	public String fileName; //文件名
	public String size;   //文件大小
	public String type;   //类型
	public String relationId; //关联主键
	
	public String sjnr; //设计内容  //for 提出资料 
	public String cjr;//创建人

	
	public UploadFileInfoVO(HttpServletRequest req) {
	    this.token = req.getParameter(UploadFileUtil.TOKEN_FIELD);
	    this.fileName = req.getParameter(UploadFileUtil.FILE_NAME_FIELD);
	    this.size = req.getParameter(UploadFileUtil.FILE_SIZE_FIELD);
	    this.type = req.getParameter(UploadFileUtil.TYPE);
	    this.relationId = req.getParameter(UploadFileUtil.RELATIIN_ID); 
	    this.sjnr = req.getParameter("sjnr");
	    SysUser user = (SysUser) req.getSession().getAttribute("userSession");
	    this.setCjr(user.getRealname());
	    
	}
	
	

}
